<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});

Route::group(['prefix' => 'reading', 'namespace' => 'Reading'], function (){

    Route::any('/checkUser', 'UserController@checkUser');

    Route::group(['prefix' => 'modern'], function () {
        Route::post('/', 'ModernController@index');
        Route::get('/info/{id}', 'ModernController@reading');
    });

    Route::group(['prefix' => 'classical'], function () {
        Route::post('/', 'ClassicalController@readList');
        Route::get('/info/{id}', 'ClassicalController@reading');
    });

    Route::group(['prefix' => 'read'], function () {
        Route::post('/readMark', 'ReadingController@readMark');
        Route::post('/readList', 'ReadingController@readList');
    });
});

Route::group(['prefix' => 'base', 'namespace' => 'Base'], function (){
    Route::get('/type/{type}', 'TypeController@typeList');
});
